$(warning $(shell mvn -version))

MVN_1 = $(shell mvn -version | sed 's/.*\"//g')
#JAVA_2 := $(shell echo ${JAVA_1} | sed 's/.*\"//g')
#JAVA_3 := $(shell echo $(JAVA_2) | sed 's/\".*$//g')
$(warning $(HOME))
$(warning $(PWD))

maven.out:  apache-maven-3.5.2-bin.tar.gz
	cd $(HOME); tar zxf $(PWD)/$<; ln -s apache-maven-3.5.2 maven
	echo "export MAVEN_HOME=$(HOME)/maven" >> /etc/profile
	echo "export PATH="'$$'"PATH:"'$$'"MAVEN_HOME/bin" >> /etc/profile
	. /etc/profile
	mvn -version
	touch $@


apache-maven-3.5.2-bin.tar.gz:
	wget http://mirrors.shuosc.org/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz


